package com.wind.controller;

import com.wind.util.ToolsUtil;
import com.wind.vo.ResultData;
import com.wind.vo.ResultDataGenerator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;


@RestController
@RequestMapping("test")
public class TestController extends BaseController{


    @RequestMapping("do")
    public ResultData<Map<String,Object>> doAuth(){
        Map<String,Object> result = new HashMap<>();
        return ResultDataGenerator.genSuccessResult(result,"查询成功");
    }

    @RequestMapping("noAuth")
    public ResultData<Map<String,Object>> noAuth(){
        Map<String,Object> result = new HashMap<>();
        String token = jwtTokenUtil.generateToken("123", ToolsUtil.randomCode(6),60*30*1L);
        result.put("token",token);
        return ResultDataGenerator.genSuccessResult(result,"查询成功");
    }

}
